<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "d_try.cart".
 *
 * @property integer $cart_id
 * @property integer $bestry_uid
 * @property integer $goods_id
 * @property integer $product_id
 * @property integer $number
 * @property string $create_time
 * @property string $update_time
 */
class Cart extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'd_try.cart';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['bestry_uid', 'goods_id', 'product_id', 'number'], 'required'],
            [['bestry_uid', 'goods_id', 'product_id', 'number'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'cart_id' => '购物车ID',
            'bestry_uid' => '优选会员uid，未登录为0',
            'goods_id' => '商品ID',
            'product_id' => '货品ID',
            'number' => '购买数量',
            'create_time' => '添加时间',
            'update_time' => '更新时间',
        ];
    }

    /**
     * @inheritdoc
     * @return \services\models\CartQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \services\models\CartQuery(get_called_class());
    }
}
